<?php

include "konek.php";
//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$a = 857;
$x=date("Y");
$cx2= $x.'-01';
$feb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx2%' and severity_level in('Low') group by(severity_level)");
//var_dump(mysql_fetch_array($jan));
$feb1=  mysql_fetch_array($feb);
$Low1 = $feb1['FEB'];

$feba = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx2%' and severity_level in('Medium') group by(severity_level)");
//var_dump(mysql_fetch_array($jan));
$feb1a=  mysql_fetch_array($feba);
$Medium1 = $feb1a['FEB'];

$febb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx2%' and severity_level in('High') group by(severity_level)");
//var_dump(mysql_fetch_array($jan));
$feb1b=  mysql_fetch_array($febb);
$High1 = $feb1b['FEB'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx3= $x.'-02';
$jan = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx3%' and severity_level in('Low') group by(severity_level)");
$jan1=  mysql_fetch_array($jan);
$Low2 = $jan1['FEB'];

$jana = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx3%' and severity_level in('Medium') group by(severity_level)");
$jan1a=  mysql_fetch_array($jana);
$Medium2 = $jan1a['FEB'];

$janb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx3%' and severity_level in('High') group by(severity_level)");
$jan1b=  mysql_fetch_array($janb);
$High2 = $jan1b['FEB'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx4= $x.'-03';
$mar = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx4%' and severity_level in('Low') group by(severity_level)");
$mar1=  mysql_fetch_array($mar);
$Low3 = $mar1['FEB'];

$mara = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx4%' and severity_level in('Medium') group by(severity_level)");
$mar1a=  mysql_fetch_array($mara);
$Medium3 = $mar1a['FEB'];

$marb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx4%' and severity_level in('High') group by(severity_level)");
$mar1b=  mysql_fetch_array($marb);
$High3 = $mar1b['FEB'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx5= $x.'-04';
$apr = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx5%' and severity_level in('Low') group by(severity_level)");
$apr1=  mysql_fetch_array($apr);
$Low4 = $apr['FEB'];

$apra = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx5%' and severity_level in('Medium') group by(severity_level)");
$apr1a=  mysql_fetch_array($apra);
$Medium4 = $apr['FEB'];

$aprb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx5%' and severity_level in('High') group by(severity_level)");
$apr1b=  mysql_fetch_array($aprb);
$High4 = $aprb['FEB'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx6= $x.'-05';
$mei = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx6%' and severity_level in('Low') group by(severity_level)");
$mei1=  mysql_fetch_array($mei);
$Low5 = $mei11['FEB'];

$meia = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx6%' and severity_level in('Medium') group by(severity_level)");
$mei1a=  mysql_fetch_array($meia);
$Medium5 = $mei11a['FEB'];

$meib = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx6%' and severity_level in('High') group by(severity_level)");
$mei1b=  mysql_fetch_array($meib);
$High5 = $mei11b['FEB'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx7= $x.'-06';
$jun = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx7%' and severity_level in('Low') group by(severity_level)");
$jun1=  mysql_fetch_array($jun);
$Low6 = $jun1['FEB'];

$juna = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx7%' and severity_level in('Medium') group by(severity_level)");
$jun1a=  mysql_fetch_array($juna);
$Medium6 = $jun1a['FEB'];

$junb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx7%' and severity_level in('High') group by(severity_level)");
$jun1b=  mysql_fetch_array($junb);
$High6 = $jun1b['FEB'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx8= $x.'-07';
$jul = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx8%' and severity_level in('Low') group by(severity_level)");
$jul1=  mysql_fetch_array($jul);
$Low7 = $jul1['FEB'];

$jula = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx8%' and severity_level in('Medium') group by(severity_level)");
$jul1a=  mysql_fetch_array($jula);
$Medium7 = $jul1a['FEB'];

$julb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx8%' and severity_level in('High') group by(severity_level)");
$jul1b=  mysql_fetch_array($julb);
$High7 = $jul1b['FEB'];


//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx9= $x.'-08';
$ag = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx9%' and severity_level in('Low') group by(severity_level)");
$ag1=  mysql_fetch_array($ag);
$Low8 = $ag1['FEB'];

$aga = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx9%' and severity_level in('Medium') group by(severity_level)");
$ag1a=  mysql_fetch_array($aga);
$Medium8 = $ag1a['FEB'];

$agb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx9%' and severity_level in('High') group by(severity_level)");
$ag1b=  mysql_fetch_array($agb);
$High8 = $ag1b['FEB'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx10= $x.'-09';
$oxt = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx10%' and severity_level in('Low') group by(severity_level)");
$oxt1=  mysql_fetch_array($oxt);
$Low9 = $oxt1['CANT'];

$oxta = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx10%' and severity_level in('Medium') group by(severity_level)");
$oxt1a=  mysql_fetch_array($oxta);
$Medium9 = $oxt1a['CANT'];

$oxtb = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx10%' and severity_level in('High') group by(severity_level)");
$oxt1b=  mysql_fetch_array($oxtb);
$High9 = $oxt1b['CANT'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx11= $x.-11;
$nop = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx11%' and severity_level in('Low') group by(severity_level)");
$nop1=  mysql_fetch_array($nop);
$Low11 = $nop1['FEB'];

$nopa = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx11%' and severity_level in('Medium') group by(severity_level)");
$nop1a=  mysql_fetch_array($nopa);
$Medium11 = $nop1a['FEB'];

$nopb = mysql_query("select count(*) as FEB from ticket where open_datetime like '%$cx11%' and severity_level in('High') group by(severity_level)");
$nop1b=  mysql_fetch_array($nopb);
$High11 = $nop1b['FEB'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$cx12= $x.-12;
$des = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx12%' and severity_level in('Low') group by(severity_level)");
$des1=  mysql_fetch_array($des);
$Low12 = $des1['CANT'];

$desa = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx12%' and severity_level in('Medium') group by(severity_level)");
$des1a=  mysql_fetch_array($desa);
$Medium12 = $des1a['CANT'];

$desb = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx12%' and severity_level in('High') group by(severity_level)");
$des1b=  mysql_fetch_array($desb);
$High12 = $desb1b['CANT'];

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$cx24= $x.-10;
$sep = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx24%' and severity_level in('Low') group by(severity_level)");
//var_dump(mysql_fetch_array($jan));
$fetch=  mysql_fetch_array($sep);
$jumlahrecord = $fetch['CANT'];
$Low10 =$jumlahrecord;

$sepa = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx24%' and severity_level in('Medium') group by(severity_level)");
//var_dump(mysql_fetch_array($jan));
$fetcha=  mysql_fetch_array($sepa);
$jumlahrecorda = $fetcha['CANT'];
$Medium10 =$jumlahrecorda;

$sepb = mysql_query("select count(*) as CANT from ticket where open_datetime like '%$cx24%' and severity_level in('High') group by(severity_level)");
//var_dump(mysql_fetch_array($jan));
$fetchb=  mysql_fetch_array($sepb);
$jumlahrecordb = $fetchb['CANT'];
$High10 =$jumlahrecordb;
$prit =date('Y/m/d');

echo "
<graph xAxisName='Severity Level by Year' yAxisName='' caption='Severity Level Average' subCaption='( $prit )' 
 decimalPrecision='0' rotateNames='1' numDivLines='3' numberPrefix='' showValues='0' formatNumberScale='0'>
	<categories>
		<category name='Jan' />
		<category name='Feb' />
		<category name='Mar' />
		<category name='Apr' />
		<category name='May' />
		<category name='Juny' />
		<category name='July' />
		<category name='Aug' />
		<category name='Sept' />
		<category name='Oct' />
		<category name='Nov' />
		<category name='Dec' />
	</categories>
	<dataset seriesName='Low' color='AFD8F8' showValues='0'>
		<set value='$Low1' />
		<set value='$Low2' />
		<set value='$Low3' />
		<set value='$Low4' />
		<set value='$Low5' />
		<set value='$Low6' />
		<set value='$Low7' />
		<set value='$Low8' />
		<set value='$Low9' />
		<set value='$Low10' />
		<set value='$Low11' />
		<set value='$Low12' />
	</dataset>
	<dataset seriesName='Medium'  color='F6BD0F' showValues='0'>
		<set value='$Medium1' />
		<set value='$Medium2' />
		<set value='$Medium2' />
		<set value='$Medium4' />
		<set value='$Medium5' />
		<set value='$Medium6' />
		<set value='$Medium7' />
		<set value='$Medium8' />
		<set value='$Medium9' />
		<set value='$Medium10' />
		<set value='$Medium11' />
		<set value='$Medium12' />
	</dataset>
	<dataset seriesName='High' color='8BBA00' showValues='0'>
		<set value='$High1' />
		<set value='$High2' />
		<set value='$High3' />
		<set value='$High4' />
		<set value='$High5' />
		<set value='$High6' />
		<set value='$High7' />
		<set value='$High8' />
		<set value='$High9' />
		<set value='$High10' />
		<set value='$High11' />
		<set value='$High12' />
	</dataset>
</graph>

";

?>